From 6e4a379e93d6c0c37b4f326063c766a324f970e6 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 19 Nov 2005 03:46:04 +0000 Subject: [PATCH] Fix crashes in connection with pathbar scrolling (#321560, Bogdan Nicula) 2005-11-18 Matthias Clasen Fix crashes in connection with pathbar scrolling (#321560, Bogdan Nicula) * gtk/gtkpathbar.c (gtk_path_bar_update_slider_buttons): Stop scrolling when desensitising slider buttons. (gtk_path_bar_scroll_timeout, gtk_path_bar_slider_button_press): And use it here. * gtk/gtkpathbar.h (struct _GtkPathBar): Add a separate scrolling_down flag. --- ChangeLog | 13 +++++++++++++ ChangeLog.pre-2-10 | 13 +++++++++++++ gtk/gtkpathbar.c | 4 +++- gtk/gtkpathbar.h | 7 ++++--- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e65c94be58..9fd880ee59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2005-11-18 Matthias Clasen + + Fix crashes in connection with pathbar scrolling (#321560, + Bogdan Nicula) + + * gtk/gtkpathbar.c (gtk_path_bar_update_slider_buttons): + Stop scrolling when desensitising slider buttons. + (gtk_path_bar_scroll_timeout, gtk_path_bar_slider_button_press): + And use it here. + + * gtk/gtkpathbar.h (struct _GtkPathBar): Add a separate + scrolling_down flag. + 2005-11-18 Matthias Clasen * gtk/gtkpathbar.c (button_clicked_cb): Fix a C99ism. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e65c94be58..9fd880ee59 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +2005-11-18 Matthias Clasen + + Fix crashes in connection with pathbar scrolling (#321560, + Bogdan Nicula) + + * gtk/gtkpathbar.c (gtk_path_bar_update_slider_buttons): + Stop scrolling when desensitising slider buttons. + (gtk_path_bar_scroll_timeout, gtk_path_bar_slider_button_press): + And use it here. + + * gtk/gtkpathbar.h (struct _GtkPathBar): Add a separate + scrolling_down flag. + 2005-11-18 Matthias Clasen * gtk/gtkpathbar.c (button_clicked_cb): Fix a C99ism. diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index cf8e802676..5a8740bc0a 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -734,7 +734,7 @@ gtk_path_bar_scroll_timeout (GtkPathBar *path_bar) { if (path_bar->scrolling_up) gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar); - else + else if (path_bar->scrolling_down) gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar); if (path_bar->need_timer) @@ -779,12 +779,14 @@ gtk_path_bar_slider_button_press (GtkWidget *widget, if (widget == path_bar->up_slider_button) { + path_bar->scrolling_down = FALSE; path_bar->scrolling_up = TRUE; gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar); } else if (widget == path_bar->down_slider_button) { path_bar->scrolling_up = FALSE; + path_bar->scrolling_down = TRUE; gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar); } diff --git a/gtk/gtkpathbar.h b/gtk/gtkpathbar.h index 2dca06b6f4..e395ccc0b0 100644 --- a/gtk/gtkpathbar.h +++ b/gtk/gtkpathbar.h @@ -61,9 +61,10 @@ struct _GtkPathBar gint16 button_offset; guint timer; guint slider_visible : 1; - guint need_timer : 1; - guint ignore_click : 1; - guint scrolling_up : 1; + guint need_timer : 1; + guint ignore_click : 1; + guint scrolling_up : 1; + guint scrolling_down : 1; }; struct _GtkPathBarClass -- 2.30.2